package thread.demo;

import thread.singleton.EnumSingleton;

public class Demo1 {
    public static synchronized void method() {
        
    }
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            while (true) {
                System.out.println("hello thread!");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }, "lambda线程");
        t.start();
        t.join(10000);

        while(true) {
            System.out.println("hello main!");
            Thread.sleep(1000);
        }
    }
}
